﻿@section HtmlHead{
}
<div class="contentpage-outerdiv">
    <h2>
        @ViewData["PageTitle"]</h2>
    <table cellpadding="5" cellspacing="5">
        <tr>
            <td>
                <table border="0" cellpadding="0" cellspacing="0" class="data-table">
                <tr><th>Title</th><th>Target Div or element</th><th></th></tr>
                    
                        @foreach (var weightedContent in Model._WeightedContents)
                        {
                            string linkText = weightedContent.Title;
                    <tr>
                        <td>
                            @Html.ActionLink(linkText, "editweightedContent", new { id = weightedContent.WeightedContentID })
                        </td>
                        <td>
                            @weightedContent.TargetDiv
                        </td>                                                
                        <td>    
                        <a href="javascript:void(0)" onclick="DeleteWeightedContent(@weightedContent.WeightedContentID )">Delete</a>
                        </td>
                    </tr>
                    }    
                    
                </table>
            </td>
        </tr>
    </table>
    <p>
        @Html.ActionLink("Create New Weighted Content", "CreateWeightedContent")
    </p>
</div> 
@section ScriptContent{
<script type="text/javascript" >
    function DeleteWeightedContent(weightedContentid) {
        if (confirm("Are you sure you want to delete this weightedContent?  Be sure to delete any widgets or modules for this first.")) {
            window.location.href = "manageweightedContents/" + weightedContentid;
        }
    }
</script>

}
